@extends('layouts.app')

@section('title', '余额提现')

@section('css-import')
<style type="text/css">
.form-input-control{
	margin-bottom: 20px;
}
.loadCardBackground{
	width: 350px;
	display: block;
	margin:15px;
}
.fancy-checkbox-re{
	display: inline-block;
}
.fancy-checkbox-paren{
	display: block;
    font-weight: normal;
}
</style>
@endsection

@section('content-fluid')

<div class="panel">
	<div class="panel-heading">
		<h3 class="panel-title">提现</h3>
	</div>
	<div class="panel-body">
		<form action="/company/take/action" method="post" id="createIdPower">
			金额
			<input type="text" name="amount" class="form-control" value="{{$account}}" readonly="readonly" autocomplete="off" placeholder="提现金额">
			<br>
			持卡人姓名
			<input type="text" name="bank_name" class="form-control" value="{{$cardinfo->bank_name ?? ''}}" autocomplete="off" placeholder="持卡人姓名">
			<br>
			银行卡号
			<input type="text" name="bank_number" class="form-control" value="{{$cardinfo->bank_number ?? ''}}" autocomplete="off" placeholder="银行卡号">
			<br>
			银行预留手机号
			<input type="text" name="bank_tel" class="form-control" value="{{$cardinfo->bank_tel ?? ''}}" placeholder="银行预留手机号" autocomplete="off">
			<br>
			所属银行
			<input type="text" name="itsbank" class="form-control" value="{{$cardinfo->itsbank ?? ''}}" placeholder="所属银行" autocomplete="off">
			<br>
			开户行
			<input type="text" name="openbank" class="form-control" value="{{$cardinfo->openbank ?? ''}}" placeholder="开户行" autocomplete="off">
			<br>
			提现描述
			<input type="text" name="desc" class="form-control" value="" placeholder="提现描述" autocomplete="off">
			<input type="hidden" name="admin_id" value="{{empty($_GET['admin_id'])?'':$_GET['admin_id']}}">
			<input type="hidden" name="bank_id" value="{{$cardinfo->bank_id ?? 0}}">
			<br><br>
			<div class="row">
				<div class="col-md-2">
					<button type="submit" class="btn btn-success btn-block">申请提现</button>
				</div>
			</div>
		</form>
	</div>
</div>
@endsection

@section('js-import')
<script type="text/javascript" src="{{config('app.inlet_src')}}/a/js/design.js"></script>
@endsection

@section('js-write')
<script type="text/javascript">
	var CouponSendParam = {
	    'dataType':'json',
	    'beforeSubmit':CouponBefore,
	    'success':CouponResponse,
	    'error':toutiaoError,
	};
	function CouponBefore(formData, jqForm, options){
	    
	}
	function CouponResponse(response) {
	    if(response.success){
	        setTimeout(function(){
	            location.href = location.href;
	        },2000);
	        toastr.success(response.message);
	    }else{
	        toastr.error('修改失败，请联系开发人员！');
	    }
	}

	function toutiaoError(XMLHttpRequest, textStatus, errorThrown) {
		if(XMLHttpRequest.status==422){
			var RegError = XMLHttpRequest.responseJSON.errors;
			for(var o in RegError){
				for (var i = 0; i < RegError[o].length; i++) {
					toastr.error(RegError[o][i]);
				}
			}
		}
	}
	ajaxForm_('#createIdPower', CouponSendParam);
</script>
@endsection